package com.ruoyi.file.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.file.domain.FileInfo;
import com.ruoyi.file.domain.qo.FileInfoPageQo;
import com.ruoyi.file.domain.qo.FileInfoQo;
import com.ruoyi.file.domain.vo.FileInfoVo;
import io.minio.GetObjectResponse;
import org.springframework.web.multipart.MultipartFile;

import java.io.InputStream;
import java.util.List;

/**
 * 文件信息表（存储Minio文件元数据信息）(FileInfo)表服务接口
 *
 * @author admin
 * @since 2025-07-23 10:50:03
 */
public interface FileInfoService extends IService<FileInfo> {

    /**
     * 上传文件
     */
//    FileInfo uploadFile(MultipartFile file, String businessType,String remark) throws Exception;

//    List<FileInfo> uploadFiles(MultipartFile[] files, String businessType,String remark) throws Exception;

    /**
     * 下载文件
     */
//    InputStream downloadFile(FileInfo fileInfo) throws Exception;

    /**
     * 获取对象
     */
//    GetObjectResponse downloadObject(FileInfo fileInfo) throws Exception;

    /**
     * 分页查询文件列表
     */
//    IPage<FileInfo> pageFiles(FileInfoPageQo pageQo);

   // void deleteFile(Long fileId);

    //void deleteFiles(List<Long> fileIds);

    public IPage<FileInfo> getPage(LambdaQueryWrapper<FileInfo> queryWrapper,Integer pageNum, Integer pageSize);
    LambdaQueryWrapper<FileInfo> getQueryWrapper(FileInfoQo fileInfo);



//    List<FileInfo> getByIds(List<Long> fileIds);

//    FileInfoVo toVo(FileInfo fileInfo);

//    FileInfo toEntity(FileInfoVo fileInfoVo);

    /**
     * 新增文件信息(本地文件)
     * @param newFileName
     * @param businessType
     * @param remark
     * @param url
     * @return
     */
    FileInfo add(String code,String newFileName, String businessType, String remark, String url);

    String importData(List<FileInfo> fileInfos, boolean updateSupport);
}

